package com.kfm.base.thread.day01;

public class Demo10 {

    public static void main(String[] args) {
        Thread thread = new Thread(() -> {
            try {
                // Thread.currentThread().join();
                Thread.sleep(3000); // TIMED_WAITING
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });



        // 线程状态 6 种状态
        Thread.State state = thread.getState();

        System.out.println(state);

        thread.start();

        System.out.println(thread.getState());

        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.println(thread.getState());

        System.out.println(Thread.currentThread().getState());
    }
}
